package com.qiguliuxing.dts.wx.vo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import com.qiguliuxing.dts.db.domain.DtsBrandMerchant;
import com.qiguliuxing.dts.db.domain.DtsCart;
import lombok.Data;

/**
 * 用于存储 品牌入驻商购物车商品的对象
 * 
 * @author qiguliuxing
 * @QQ 623659388
 * @since 1.0.0
 */
@Data
public class BrandCartGoods implements Serializable {

	private static final long serialVersionUID = -7908381028314100456L;

	private static final Integer DEFAULT_BRAND_ID = 1001000;

	private static final String DEFAULT_BRAND_COMPANY = "聚惠星自营店";

	private static final String DEFAULT_BRAND_NAME = "聚惠星自营店";

	private Integer brandId;

	private String brandName;

	private String brandCompany;

	private List<DtsCart> cartList;

	private BigDecimal bandGoodsTotalPrice;

	private BigDecimal bandFreightPrice;

	public static BrandCartGoods init(DtsBrandMerchant dtsBrand) {
		BrandCartGoods bcg = new BrandCartGoods();
		if (dtsBrand != null) {
			bcg.setBrandId(dtsBrand.getId());
			bcg.setBrandCompany(dtsBrand.getCompany());
			bcg.setBrandName(dtsBrand.getName());
		} else {
			bcg.setBrandId(DEFAULT_BRAND_ID);
			bcg.setBrandCompany(DEFAULT_BRAND_COMPANY);
			bcg.setBrandName(DEFAULT_BRAND_NAME);
		}
		List<DtsCart> dtsCartList = new ArrayList<DtsCart>();
		bcg.setCartList(dtsCartList);
		return bcg;
	}

}
